<?php
//print_r($_SESSION);
global $current_user;
if($_SESSION['success_message_reg']=="success_reg"){
	?>
    <div class="sucess_msg timer"> <?php _e(AFFILIATE_LOGIN_REG_COMPLETED_MSG); ?> </div>
    <?php
	//$_SESSION['success_message_reg']="";
	//session_unregister();
}
if(!$current_user->data->ID){
?>
<div class="quick_login" style="display:none;">
<div class="close" title="Close">close</div>
	<div class="info">
<p>If you are an existing customer of <?php bloginfo(); ?>  or have previously registered you may login or request a new password. Otherwise <a href="<?php global $General; echo $General->get_url_login(site_url('/?ptype=login')); ?>">Register here</a> and an account will be created for you.
</p>
    </div>
    <div class="fr">
    <form name="loginform" id="loginform" action="<?php global $General; echo $General->get_url_login(site_url('/?ptype=login')); ?>" method="post">
              <div class="form_row">
                <label>
                <?php _e(USERNAME_TEXT) ?>
                </label>
                <input type="text" name="log" id="user_login" value="<?php echo esc_attr($user_login); ?>" size="20" class="form_textfield"  />
              </div>
              <div class="form_row">
                <label>
                <?php _e(PASSWORD_TEXT) ?>
                </label>
                <input type="password" name="pwd" id="user_pass" class="form_textfield" value="" size="20" />
                 <a  href="javascript:void(0);" onclick="return chk_form_login();" class="login" ><?php _e(Login);?></a>
              </div>
              <?php do_action('login_form'); ?>
              <p class="forgetmenot">
                <input name="rememberme" type="checkbox" id="rememberme" value="forever" class="fl" />
                <?php esc_attr_e('Remember me on this computer'); ?>
              </p>
			 <?php
             if(strstr($_SESSION['redirect_page'],'ptype=checkout'))
            {
                $login_redirect_link = site_url('/?ptype=cart');
                //session_unregister(redirect_page);
            }else
            {
				global $General;
                $login_redirect_link = $General->get_url_login(site_url('/?ptype=login'));
            }
            ?>
              <input type="hidden" name="redirect_to" value="<?php echo $login_redirect_link; ?>" />
              <span class="forgot_password"> <a href="javascript:void(0);showhide_forgetpw();"><?php _e(FORGET_PW_TEXT);?></a></span>
              <input type="hidden" name="testcookie" value="1" />
          </form>
           <!-- login form #end -->
           <div id="lostpassword_form" class="lost-pswd" style="display:none;">
            <form name="lostpasswordform" id="lostpasswordform" action="<?php global $General; echo $General->get_url_login(site_url('/?ptype=login&amp;action=lostpassword')); ?>" method="post">
              <label>Enter<?php _e(USERNAME_EMAIL_TEXT) ?></label>
              <input type="text" name="user_login" id="user_login1" value="<?php echo esc_attr($user_login); ?>" size="20" class="lostpass_textfield" />
              <?php do_action('lostpassword_form'); ?>
              <a  href="javascript:void(0);" onclick="document.lostpasswordform.submit();" class="login fr " ><?php _e(GET_NEW_PASSWORD_TEXT);?></a>
            </form>
          </div>
          <script type="text/javascript" >
function chk_form_login()
{
	if(document.getElementById('user_login').value=='')
	{
		alert('<?php _e('Please enter '.USERNAME_TEXT) ?>');
		document.getElementById('user_login').focus();
		return false;
	}
	if(document.getElementById('user_pass').value=='')
	{
		alert('<?php _e('Please enter '.PASSWORD_TEXT) ?>');
		document.getElementById('user_pass').focus();
		return false;
	}
	//return true;
	document.loginform.submit();
}
function showhide_forgetpw()
{
	if(document.getElementById('lostpassword_form').style.display=='none')
	{
		document.getElementById('lostpassword_form').style.display = ''
		document.getElementById('loginform').style.display = 'none';
		//document.getElementById('reg_form_div_id').style.display = 'none';
	}	
}
</script>
    </div>
    </div>
<?php } ?>	
<div id="header" >
  <div id="header-in" class="container_16 clearfix">
    <div class="header_left">
      <?php if ( get_option('ptthemes_show_blog_title') ) { ?>
      <?php if ( get_option('ptthemes_logo_url') ) { ?>
      <a href="<?php echo get_option('home'); ?>/"><img src="<?php echo get_option('ptthemes_logo_url'); ?>" alt="<?php bloginfo('name'); ?>" class="photo"  /></a>
      <?php } else { ?>
      <?php } ?>
      <div class="blog-title"><a href="<?php echo get_option('home'); ?>/">
        <?php bloginfo('name'); ?>
        </a> </div>
      <p class="blog-description">
        <?php bloginfo('description'); ?>
      </p>
      <?php } else { ?>
	<?php
    if(CHILDTEMPLATEPATH && file_exists(CHILDTEMPLATEPATH . '/images/logo.png'))
    {
        $logo_image = get_stylesheet_directory_uri().'/images/logo.png';
    }else
    {
        $logo_image = get_bloginfo('template_directory').'/images/logo.png';
    }
    ?>
      <a href="<?php echo get_option('home'); ?>/"><img src="<?php if ( get_option('ptthemes_logo_url') <> "" ) { echo get_option('ptthemes_logo_url'); } else { echo $logo_image; } ?>" alt="<?php bloginfo('name'); ?>" class="logo"  /></a>
      <?php } ?>
    </div>
    <!--/logo-->
    <div class="customer-care">
    	<div class="phone">+91- 9645887840 <small>(IST. 9.00am-6.00pm)</small></div>
    <!-- live2support.com tracking codes starts -->
    <div id="l2s_trk" style="z-index:99;">
    <a href="http://live2support.com" style="font-size:1px;">Live Help Software</a>
    </div>
	<script type="text/javascript"><!-- 
 var l2s_pht=escape(location.protocol); if(l2s_pht.indexOf("http")==-1) l2s_pht='http:'; 
 var off2="<?php bloginfo('template_url'); ?>/images/offline.png"; 
 var on2="<?php bloginfo('template_url'); ?>/images/online.png"; 
 	function l2s_load() {
	 document.write('<scr'+'ipt type="text/javascr'+'ipt" src ="'+unescape(l2s_pht)+'//sa.live2support.com/js/lsjs1.php?stid=20321&cmi=1"  defer=true>'+'</scr'+'ipt>');  } 
	l2s_load();
	document.getElementById('l2s_trk').style.visibility='hidden'; //-->
    </script>
    <!-- live2support.com tracking codes closed -->
    </div>
    <div class="main_navi" >
   
    <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Header Main Navigation') ){}else{  ?>
   <?php if ( function_exists('dynamic_sidebar') ) { // Header Top Navigation Menu ?>
	 		<div class="top_navigation">	<?php dynamic_sidebar('Header Top Navigation'); ?> </div>
	 <?php } ?> 
    <?php
 		global $wpdb;
 		$blogcatname = get_option('ptthemes_blogcategory');
 		$catid = $wpdb->get_var("SELECT term_ID FROM $wpdb->terms WHERE name = '$blogcatname'");
   		 ?>
           

     <ul class="nav-main">
      <?php $General->show_home_link_header_nav();?>
	  <?php $General->show_store_link_header_nav();?>
      <?php $General->show_blog_link_header_nav(); ?>
	  <?php $General->show_category_header_nav();?>
	  <?php $General->show_pages_header_nav(); ?>
    </ul>
    
     <?php }?>
       
   <?php /*?> <?php if ( function_exists('dynamic_sidebar')) { // Header Main Navigation Menu ?>
	 <?php dynamic_sidebar('Header Main Navigation'); ?>
	 <?php }?><?php */?>
    <?php
    if(CHILDTEMPLATEPATH && file_exists(CHILDTEMPLATEPATH . '/header_nav_right.php'))
	{
		include(CHILDTEMPLATEPATH . '/header_nav_right.php');
	}
	?>
 </div>
 <div class="global-features">
 	<ul>
    <li class="shipping">Free shipping</li>
    <li class="cod">Cash on delivery</li>
    <li class="dispatch">24 hrs dispatch</li>
    <li class="last">
     <?php if ( function_exists('dynamic_sidebar') ) { // Cart Menu ?>
  			<?php dynamic_sidebar('My Cart Sidebar Left'); ?>
	 <?php } ?> </li>
    </ul>
 </div>
  </div>
</div>
<!-- header #end -->

 <?php 
 // Header Main Navigation Menu  START
 
?>
   
 <?php
  // Header Main Navigation Menu  END
 ?>
 <?php if(is_category()||$_GET['ptype']=="store"){
   if ( function_exists('dynamic_sidebar')) { // category page widget top render ?>
 	<div class="container_16"><div class="outer-ad" ><?php dynamic_sidebar(3); ?> </div> </div>
<?php } }?>
 <?php if(is_single()){
   if ( function_exists('dynamic_sidebar')) { // post page widget render ?>
 	
    <div class="container_16"><div class="outer-ad" ><?php dynamic_sidebar(4); ?> </div> </div>
<?php } }?>


 
 <?php
if ( is_home() && !$_GET['ptype'] ) { ?>

 	<div class="home_banner">
             <?php  if ( function_exists('dynamic_sidebar') && (is_sidebar_active(1)) ) { // Show on the front page ?>
							<?php  dynamic_sidebar(1); ?>  
                     <?php } ?>
      <div class="banner_right">  
      <div class="banner_right_col1">
        <?php  if ( function_exists('dynamic_sidebar') && (is_sidebar_active(26)) ) { // Show on the front page ?>
		 <?php  dynamic_sidebar(26); ?>  
           <?php } ?>
         </div>
         
         <div class="banner_right_col2">
        <?php  if ( function_exists('dynamic_sidebar') && (is_sidebar_active(27)) ) { // Show on the front page ?>
		 <?php  dynamic_sidebar(27); ?>  
           <?php } ?>
         </div>
         
         <?php  if ( function_exists('dynamic_sidebar') && (is_sidebar_active(25)) ) { // Show on the front page ?>
		 <?php  dynamic_sidebar(25); ?>  
           <?php } ?>
      </div>    
       
     
 </div>
 
 <?php   
} else {  ?> <?php } ?>
 
  <!-- banner #end -->
 
             	
       
           